package com.hyperchain.notification;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class NotificationStrategy {

    @Autowired
    private NotificationFactory factory;

    public String doMethod(NotificationType notificationType){
        NoticeCationBaseStrategy noticeCationBaseStrategy = factory.getNoticeCationBaseStrategy(notificationType);
        //----获取到策略后即可开始执行业务逻辑
        String method = noticeCationBaseStrategy.method();
        return "执行了一次method方法："+method;
    }
}
